<#include "../base.ftl"/>
<#macro cssfile>
</#macro>

<#macro scriptfile>
</#macro>

<#macro breadcrumb>
    <ul class="breadcrumb">
     <#include "../crumb.ftl"/>
     <li class="active">船东信息</li>
    </ul>
</#macro>

<#macro title>
广大物流云平台
</#macro>

<#macro jsscript>
jQuery(document).ready(function(){
    jQuery("#gridTable").jqGrid({
        url : '${request.contextPath}/list/baseInfo/TsmShipowner/list.html',
        editurl : '${request.contextPath}/operator/tsm/TsmShipowner/operator.html',
        datatype : 'json',
        mtype : 'POST',
        height: 270,
        autowidth: true,
        colNames: ['船东编号','船东代码','名称','简称','法人','注册号','成立日期',
                   '邮编','地址','状态','创建人','创建日期','最后修改人','最后修改日期'],
        colModel: [
                 {name: 'ownerId', jsonmap: 'OWNER_ID', index:'OWNER_ID', editable: false,hidden:true,searchoptions:{ sopt:["eq","cn"]}},
                 {name: 'ownerCode', jsonmap: 'OWNER_CODE', index:'OWNER_CODE', editable: true,editrules:{required:true}},
                 {name: 'ownerName', jsonmap: 'OWNER_NAME', index:'OWNER_NAME', editable: true,editrules:{required:true}},
                 {name: 'shortName', jsonmap: 'SHORT_NAME', index:'SHORT_NAME', editable: true,editrules:{required:true}},
                 {name: 'legal', jsonmap: 'LEGAL', index:'LEGAL', editable: true,editrules:{required:true}},
                 {name: 'registryNo', jsonmap: 'REGISTRY_NO', index:'REGISTRY_NO', editrules:{required:true},editable: true},
                 {name: 'establishDate', jsonmap: 'ESTABLISH_DATE', index:'ESTABLISH_DATE', editable: true,editrules:{required:true},
                         formatter : 'date',formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'},
                         editoptions :  {dataInit: function(element) {
                         $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                        }}
                  },
                 {name: 'zipCode', jsonmap: 'ZIP_CODE', index:'ZIP_CODE', editable: true,searchoptions:{ sopt:["eq","cn"]}},
                 {name: 'address', jsonmap: 'ADDRESS', index:'ADDRESS', editable: true,searchoptions:{ sopt:["eq","cn"]}},
                 {name: 'status', jsonmap: 'STATUS', index:'STATUS', editable: false,hidden:true,searchoptions : {sopt : [ "eq", "cn"]}},
                 {name: 'created_by', jsonmap: 'CREATED_BY', index:'CREATED_BY',hidden:true,editable: false,searchoptions:{ sopt:["eq","cn"]}},
                 {name: 'created_date', jsonmap: 'CREATED_DATE',index:'CREATED_DATE',hidden:true,editable: false,formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d H:i:s',newformat : 'Y-m-d H:i:s'},align : 'center',searchoptions : {sopt:["eq","cn"]}},
                 {name: 'last_upd_by', jsonmap: 'LAST_UPD_BY',index:'LAST_UPD_BY',hidden:true,editable: false,searchoptions:{ sopt:["eq","cn"]}},
                 {name: 'last_upd_date', jsonmap: 'LAST_UPD_DATE',index:'LAST_UPD_DATE',hidden:true, editable: false,formatter : 'date',
                        formatoptions : {srcformat : 'Y/m/d H:i:s',newformat : 'Y-m-d H:i:s'},align : 'center',searchoptions : {sopt:["eq","cn"]}}     
            ],
            sortname: 'LAST_UPD_DATE',
            sortorder: 'desc',
            viewrecords: true,
            gridview: true,
            rownumbers : true,   
            rowNum: 20,
            rowList: [10,20,30],  
            pager: "#gridPager",
            jsonReader :{
                page: "page.pageNo",  //固定名称
                total: "page.totalPages", //固定名称
                records: "page.totalCount", //固定名称
                root: "page.result", //固定名称
                repeatitems : false, //固定
                id: 'OWNER_ID'
            },  
            prmNames:{rows:"page.pageSize",page:"page.pageNo",sort:"page.orderBy",order:"page.order"},
            pager : "#gridPager",
            caption : "船东列表"
            }).navGrid('#gridPager',{
                edit: true,
                add: true,
                del: true,
                search: true
             },{
                //edit
                beforeShowForm: function(form) {},
                reloadAfterSubmit : true,
                closeAfterEdit : true, //修改完毕后关闭
                afterComplete : opertaionPrompt  
             },{
                //add
                beforeShowForm: function(form) {},
                reloadAfterSubmit : true,
                closeAfterAdd : true, //新增完毕后关闭
                afterComplete : opertaionPrompt              
             },{
                //del
                reloadAfterSubmit : true,
                afterComplete : opertaionPrompt
             }, {
                //组合查询
                multipleSearch : true
             });
});

</#macro>

<#macro main>
<table id="gridTable"></table>
<div id="gridPager"></div>
</#macro>